<template>
  <div>
    <h2>商品管理</h2>
    <div>
      name: <span>{{ getName }}</span>
    </div>
    <div>
      age:<span>{{ getAge }}</span>
    </div>
  </div>
</template>

<script>
import { mapState, mapGetters } from "vuex"; //导入Vuex的辅助函数
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState(["name", "age"]),
    ...mapGetters(["getName", "getAge"]),
  },
};
</script>

<style>

</style>
